//
//  ConstantHeader.h
//  Demo
//
//  Created by Kyle on 2022/12/31.
//

#ifndef ConstantHeader_h
#define ConstantHeader_h

//IphoneX IphoneXR IphoneXS  IphoneXSMAX
#define isIphoneX \
({BOOL isPhoneX = NO;\
if (@available(iOS 11.0, *)) {\
isPhoneX = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom > 0.0;\
}\
(isPhoneX);})

#define KSafeAreaInset \
({UIEdgeInsets KSafeAreaInset = UIEdgeInsetsZero;\
if (@available(iOS 11.0, *)) {\
KSafeAreaInset = [[UIApplication sharedApplication] delegate].window.safeAreaInsets;\
}\
(KSafeAreaInset);})

//判断ios 11
#define IF_iOS11 @available(iOS 11.0, *)

//判断ios 10
#define IOS10_ORLater ([[UIDevice currentDevice].systemVersion floatValue] >= 10.0 ? YES : NO)

#define kNavHeight  (isIphoneX ? 88 : 64)
#define kTabbarHeight (isIphoneX ? 83 : 49)

// block self
#define mWeakSelf  __weak typeof (self)weakSelf = self;
#define mStrongSelf typeof(weakSelf) __strong strongSelf = weakSelf;


//屏幕宽高的宏定义
#define KScreenWidth [UIScreen  mainScreen].bounds.size.width
#define KScreenHeight [UIScreen mainScreen].bounds.size.height

//横屏
#define kMaxScreenWidth MAX([UIScreen mainScreen].bounds.size.width,[UIScreen mainScreen].bounds.size.height)

//横屏
#define kMinScreenHeight MIN([UIScreen mainScreen].bounds.size.width,[UIScreen mainScreen].bounds.size.height)

#define APPBlackColor [UIColor colorWithString:@"#000000"]

#define APPColor [UIColor colorWithString:@"#F0FFCE"]

#define APPDelegate      ((AppDelegate*)[[UIApplication sharedApplication] delegate])


#endif /* ConstantHeader_h */
